package cn.bone.web.utils;

import org.apache.commons.codec.digest.DigestUtils;

import java.io.UnsupportedEncodingException;

/**
 * Created by MD-01 on 2017/4/14.
 */
public class Md5Util {
    /**
     * md5加密
     */
    public static String md5(String str){

        String result = null;
        try {
            result = DigestUtils.md5Hex(str.getBytes("UTF-8"));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return result;
    }
}
